// 引入express模块
const express = require('express');
const admin = express.Router();
const { User } = require('../model/user');
const trim = require('trim')
const bcrypt = require('bcrypt')
const session = require('express-session')
admin.get('/login', require('./admin/loginPage'))
admin.post('/login', require('./admin/login'));
// 退出功能
admin.get('/logout', require('./admin/logout'))

admin.get('/user', require('./admin/user'));
admin.get('/user-edit', require('./admin/user-edit'));
admin.post('/user-edit', require('./admin/user-edit-fn'))
admin.post('/user-modify', require('./admin/user-modify'))
admin.get('/user-delete', require('./admin//user-delete'))

// 文章列表页面路由
admin.get('/article', require('./admin/article'));
// 文章编辑页面路由
admin.get('/article-edit', require('./admin/article-edit'));
// 文件提交页面
admin.post('/article-add', require('./admin/article-add'));
module.exports = admin